<template>
  <div class="official-rank">
    <h3 class="title">{{ title }}</h3>
    <div class="item"  v-for="item in topList" :key="item.id">
      <div class="icon">
        <img v-lazy="item.coverImgUrl" width="100" height="100">
      </div>
      <div class="songlist">
        <div class="song" v-for="(song, index) in item.tracks" :key="index" :class="{on:index%2 == 0}">
          <div class="song-info">
            <span v-if="index < 5" :class="{ num:index <= 2 }">{{index + 1}}.</span>
            <span v-if="index < 5">{{ song.name }}</span>
          </div>
          <div class="singer">
            <span v-if="index < 5">{{ song.ar[0].name }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props:{
      title: String,
      topList:[],
      songlist:[],
    },
  }
</script>

<style scoped>
.title{
  padding-left: 10px;
}

.item{
  display: flex;
  margin: 0 10px;
  padding: 3px 0;
  height: 100px;
  border-bottom: 1px solid rgb(228, 228, 228);
}

.icon{
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  padding-right: 20px;
}

.icon img{
  border-radius: 3px;
}

.songlist{
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100px;
  overflow: hidden;
}

.song{
  width: 100%;
  display: flex;
}

.song-info{
  flex: 1;
}

.song span{
  font-size: 13px;
}

.on{
  background: rgb(239, 239, 239);
}

.num{
  /* color: #fc6464; */
  color: red;
}
</style>